package com.cicigodd.brick.plug.upload.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cicigodd.brick.plug.upload.api.SysFileServiceApi;
import com.cicigodd.brick.plug.upload.entity.SysFile;
import com.cicigodd.brick.plug.upload.request.SysFileDownRequest;
import com.cicigodd.brick.plug.upload.request.SysFileIdDownRequest;
import com.cicigodd.brick.plug.upload.request.SysFileRequest;
import com.cicigodd.brick.plug.upload.response.SysFileResponse;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * 文件管理
 *
 * @author cicigodd
 * @date 2022/09/23 08:42:00
 */
public interface SysFileService extends IService<SysFile>, SysFileServiceApi {


    /**
     * 文件上传
     * @param file
     * @return
     */
    SysFileResponse upload(MultipartFile file);

    /**
     * 文件预览
     * @param sysFileRequest
     * @param response
     */
    void previewByBucketAndObjName(SysFileRequest sysFileRequest, HttpServletResponse response);

    /**
     * 文件下载
     * @param sysFileDownRequest
     * @param response
     */
    void download(SysFileDownRequest sysFileDownRequest, HttpServletResponse response);

    /**
     * 文件下载
     * @param sysFileDownRequest
     * @param response
     */
    void downloadById(SysFileIdDownRequest sysFileDownRequest, HttpServletResponse response);
}